import matplotlib.pyplot as plt
from wordcloud import WordCloud
import jieba
import cv2 as cv

text_from_file_with_apath = open('./text.txt').read()

wordlist_after_jieba = jieba.cut(text_from_file_with_apath, cut_all = True)
wl_space_split = " ".join(wordlist_after_jieba)

my_wordcloud = WordCloud(background_color="white", font_path="./song.ttf", max_font_size=60).generate(wl_space_split)

plt.imshow(my_wordcloud)
plt.axis("off")
plt.show()

my_wordcloud.to_file("img.png")

